<?php
namespace Apps\Model;
use Phalcon\Mvc\Model;

/*
仓位model
 */
class Bin extends Model{
    public $id;
    public $area_id;
    public $big_trans_type_id;
    public $trans_type_id;
    public $price;
    public $weight;
    public $num;
    public $lastdate;
    public $info;
   
/*
Independent Column Mapping.
 */
	public function columnMap(){
        return array(
            'id'                => 'id', 
            'area_id'           => 'area_id', 
			'big_trans_type_id' => 'big_trans_type_id',
			'trans_type_id'     => 'trans_type_id',
            'weight'            => 'weight',
            'num'               =>'num',
            'price'             => 'price',
            'lastdate'          =>'lastdate',
            'info'              =>'info'
        );
    }


    public function initialize() {
        $this->setSource('dg_bin');
        $this->belongsTo('area_id','Apps\Model\Area','id');
        $this->belongsTo('trans_type_id','Apps\Model\Transtype','id');
        //$this->hasMany('id','Apps\Model\Mycw','cw_id');
	}

    public function getArea($parameters=null){
        return $this ->getRelated('Apps\Model\Area',$parameters);
    }

    public function getTranstype($parameters=null){
        return $this ->getRelated('Apps\Model\Transtype',$parameters);
    }

}
